package fr.neyb.bernouilli.problem016;

import java.io.Reader;
import java.io.StringReader;
import java.math.BigInteger;

public class Entry {

	private static final int pow = 1000;

	public static void main(String... args) throws Exception {
		BigInteger bi = new BigInteger("1");
		BigInteger two = new BigInteger("2");

		for (int i = 1; i <= pow; ++i) {
			bi = bi.multiply(two);
		}

		Reader r = new StringReader(bi.toString());
		int c;
		int sum = 0;

		while ((c = r.read()) >= 0) {
			sum += Integer.parseInt("" + (char) c);
		}

		System.out.println(bi);
		System.out.println(sum);
	}

}
